package com.tian.mybatis.util;

import java.util.ArrayList;
import java.util.List;

/**
 * @author tianwc  公众号：java后端技术全栈、面试专栏
 * @version 1.0.0
 * @date 2023年09月21日 18:14
 * 在线刷题 1200+题和1000+篇干货文章：<a href="https://woaijava.cc/">博客地址</a>
 * <p>
 * //select * from user where id=#{id}
 * //select * from user where id=#{id} and userName=#{userName}
 * <p>
 * //但是JDBC只认识 select * from user where id=?
 * //select * from user where id=? and userName=?
 * //不认识带#的参数
 */
public class ParameterMappingTokenHandler implements TokenHandler {
    private List<ParameterMapping> parameterMappingList = new ArrayList<>();

    @Override
    public String handlerToken(String content) {
        ParameterMapping parameterMapping = new ParameterMapping();
        parameterMapping.setContent(content);
        parameterMappingList.add(parameterMapping);
        return null;
    }

    public List<ParameterMapping> getParameterMappingList() {
        return parameterMappingList;
    }

    public void setParameterMappingList(List<ParameterMapping> parameterMappingList) {
        this.parameterMappingList = parameterMappingList;
    }
}
